import lombok.Data;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * 游戏结果处理器
 * @author cxh
 * @date 2022/4/26 15:58
 */
@Data
public class GameCollect {

    static GameCollect gameCollect = null;

    /**
     * 游戏结果集
     */
    public List<GameResult> gameResultList = new ArrayList<>();

    /**
     * 私有化构造函数
     */
    private GameCollect(){};

    /**
     * 获取单例
     * @return
     */
    public static GameCollect getInstance(){

        if (gameCollect == null){
            gameCollect = new GameCollect();
            gameCollect.setGameResultList(new ArrayList<>());
        }

        return gameCollect;

    }

    /**
     * 处理游戏结果
     * @param gameResult
     */
    public static void dealGameResult(GameResult gameResult){
        getInstance().getGameResultList().add(gameResult);
    }


}
